# name : Delete file using macro
# key : file.delete.macro
# contributor: Shuguang Sun
# --
%macro ${1:delete_file}(file);
  %if %sysfunc(fileexist(%bquote(&file.))) ge 1 %then %do;
     %let rc = %sysfunc(filename(temp, %bquote(&file.)));
     %let rc = %sysfunc(fdelete(&temp.));
  %end;
  %else %put The file &file. does not exist;
%mend $1;

%$1("${2:path/to/file}")